<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Glue code</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Glue_code"> <link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Glue_code rootpage-Glue_code skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Glue code</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1305433154">
/* start https://en.wikipedia.org/ */
.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}
/* end https://en.wikipedia.org/ */
</style>
<p>In <a href="Computer_programming" title="Computer programming">computer programming</a>, <b>glue code</b> is <a href="Source_code" title="Source code">code</a> that allows components to <a href="Interoperability#Software" title="Interoperability">interoperate</a> that otherwise are <a href="Software_incompatibility" title="Software incompatibility">incompatible</a>. The <a href="Adapter_pattern" title="Adapter pattern">adapter pattern</a> describes glue code as a <a href="Software_design_pattern" title="Software design pattern">software design pattern</a>.
</p><p>Glue code describes <a href="Language_binding" title="Language binding">language bindings</a> or <a href="Foreign_function_interface" title="Foreign function interface">foreign function interfaces</a> such as the <a href="Java_Native_Interface" title="Java Native Interface">Java Native Interface</a> (JNI).
</p><p>Glue code may be written to access existing <a href="Library_(computing)" title="Library (computing)">libraries</a>, map <a href="Object_(computer_science)" title="Object (computer science)">objects</a> to a <a href="Database" title="Database">database</a> using <a href="Object-relational_mapping" class="mw-redirect" title="Object-relational mapping">object-relational mapping</a>, or <a href="Systems_integration" class="mw-redirect" title="Systems integration">integrate</a> <a href="Commercial_off-the-shelf" title="Commercial off-the-shelf">commercial off-the-shelf</a> programs.
</p><p>Glue code may be written in the same language as the code it is gluing together, or in a separate <a href="Glue_language" class="mw-redirect" title="Glue language">glue language</a>.
</p><p>Glue code can be key to <a href="Rapid_prototyping" title="Rapid prototyping">rapid prototyping</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Adapter_pattern" title="Adapter pattern">Adapter pattern</a></li>
<li><a href="Scripting_language" title="Scripting language">Scripting language</a></li>
<li><a href="Shell_script" title="Shell script">Shell script</a></li>
<li><a href="SWIG" title="SWIG">SWIG</a></li>
<li><a href="Lua_(programming_language)" class="mw-redirect" title="Lua (programming language)">Lua (programming language)</a></li>
<li><a href="Glue_logic" title="Glue logic">Glue logic</a></li>
<li><a href="WinGlue" class="mw-redirect" title="WinGlue">WinGlue</a></li>
<li><a href="Wrapper_function" title="Wrapper function">Wrapper function</a></li>
<li><a href="Wrapper_library" title="Wrapper library">Wrapper library</a></li>
<li><a href="Method_stub" title="Method stub">Method stub</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
</div>
<ul><li><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFStolpmann" class="citation web cs1">Stolpmann, Gerd. <a rel="nofollow" class="external text" href="http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/x341.html">"Chapter 5. Complex packages: Glue code"</a>. findlib User's Guide. Caml City.</cite></li>
<li><cite id="CITEREFPryce" class="citation web cs1">Pryce, Nathaniel. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20170331130516/http://www.doc.ic.ac.uk/%7Enp2/patterns/scripting/glue-code.html">"Glue Code"</a>. <i>Scripting</i>. Patterns. <a href="Department_of_Computing%2C_Imperial_College_London" title="Department of Computing, Imperial College London">Department of Computing</a>, <a href="Imperial_College_London" title="Imperial College London">Imperial College London</a>. Archived from <a rel="nofollow" class="external text" href="http://www.doc.ic.ac.uk/~np2/patterns/scripting/glue-code.html">the original</a> on 2017-03-31.</cite></li>
<li><cite id="CITEREFLethbridgeLaganière2001" class="citation web cs1">Lethbridge, Timothy C.; Laganière, Robert (2001-11-21) [Summer 2001]. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20170712055627/http://www.site.uottawa.ca:4321/oose/index.html#glue_code">"Object Oriented Software Engineering: Practical Software Development using UML and Java"</a>. <a href="McGraw_Hill" class="mw-redirect" title="McGraw Hill">McGraw Hill</a> / <a href="University_of_Ottawa" title="University of Ottawa">University of Ottawa</a>. Glue Code. Archived from <a rel="nofollow" class="external text" href="http://www.site.uottawa.ca:4321/oose/index.html#glue_code">the original</a> on 2017-07-12.</cite></li></ul>
<style data-mw-deduplicate="TemplateStyles:r1271159938">
/* start https://en.wikipedia.org/ */
.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox-body{font-style:italic}.mw-parser-output .asbox-note{font-size:smaller}.mw-parser-output .asbox .navbar{position:absolute;top:-0.75em;right:1em;display:none}.mw-parser-output :not(p):not(.asbox)+style+.asbox,.mw-parser-output :not(p):not(.asbox)+link+.asbox{margin-top:3em}
/* end https://en.wikipedia.org/ */
</style></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2024-05-04" href="https://en.wikipedia.org/wiki/?title=Glue_code&oldid=1222200009">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>